// pages/new/new.js
const fetch = require("../../request/fetch")
Page({

  /**
   * 页面的初始数据
   */
  data: {
    bigImgSrc:'../../images/oder/1.jpg',
    coffee:[],
    taste:[],
    coffeeNum:0,
    tasteNum:0
  },
  onLoad(){
    fetch.showApi().then(res=>{
      if(res.errno===0){
        let{coffee,taste}=res.data
        // console.log(coffee);
        // console.log(taste);
        this.setData({
           coffee,taste
        })
        // console.log(this.data);
      }
    })
  },
  getShowcoffee(e){
      let myindex = e.currentTarget.dataset.myindex
      // console.log(myindex);
      this.setData({
        coffeeNum:myindex
      })
  },
  getShowtaste(e){
    let myindex = e.currentTarget.dataset.myindex
    this.setData({
      tasteNum:myindex
    })
  }
})                                                               